import * as types from './actions-type'
export function setShouldLoad(payload) {
    return {
        type: types.SET_SHOULD_LOAD,
        payload
    }
}
export function setOneLevelPartitions(payload) {
    return {
        type: types.SET_ONE_LEVEL_PARTITIONS,
        payload
    }
}
export function setBanners(payload) {
    return {
        type: types.SET_BANNERS,
        payload
    }
}
export function setRankingVideos(payload) {
    return {
        type: types.SET_RANKING_VIDEOS,
        payload
    }
}

export function updatePersons(temp) {
    let { index, ...person } = temp
    return (dispatch, getState) => {
        let { persons } = getState()
        let data = [...persons]
        data.splice(index, 1, person)
    }
}
export function setTabindex(payload) {
    return {
        type: types.SET_TABINDEX,
        payload
    }
}
export function ToggleIsdraw() {
    return (dispatch, getState) => {
        const { isdraw } = getState()
        dispatch({
            type: types.SET_ISDRAW,
            payload: !isdraw
        })
    }
}
export function SetAdditionalvideos(payload) {
    return {
        type: types.SET_ADDITIONAL_VIDEOS,
        payload
    }
}
export function setPartitions(payload) {
    return {
        type: types.SET_PARTITIONS,
        payload
    }
}
export function setLiveData(payload) {
    return {
        type: types.SET_LIVE_DATA,
        payload
    }
}
export function setLiveList(payload) {
    return {
        type: types.SET_LIVE_LIST,
        payload
    }
}
export function setRoomData(payload) {
    return {
        type: types.SET_ROOM_DATA,
        payload
    }
}
export function setRankingPartitions(payload) {
    return {
        type: types.SET_RANKING_PARTITIONS,
        payload
    }
}
export function setUpUserInfo(payload) {
    return {
        type: types.SET_UP_USER,
        payload
    }
}
export function setVideoinfo(payload) {
    return {
        type: types.SET_VIDEO_INFO,
        payload
    }
}
